Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packaging initial infrastructure #133

Merged
merged 10 commits into from
Jul 29, 2024
Merged

Packaging initial infrastructure #133

merged 10 commits into from
Jul 29, 2024

Conversation

Mpdreamz
Copy link
Member

@Mpdreamz Mpdreamz commented Jul 24, 2024

Not complete but enough to review as part 1 😄

  • Introduces our own version of OpenTelemetry.AutoInstrumentation named Elastic.OpenTelemetry.AutoInstrumentation.

Through a bit of msbuild magic we redistribute instrument.{sh|cmd} as _instrument.{sh|cmd} and introduce our own instrument.{sh|cmd} that sets the appropiate plugin environment variable before calling the opentelemetry instrument script.

This allows the invocation to be exactly the same no matter if our distribution or the vanilla opentelemetry package is installed. A user can move from or away from Elastic without having to touch orchestration work. Simply installing the package is enough to move to or away from us.

  • This PR includes the start of a ./build.sh redistribute build command that redistributes the opentelemetry autoinstrumentation zip files that include our AutoInstrumentation plugin.

A follow up of this PR will focus on creating Elastic versions of the global auto instrumentation installation scripts and ensuring these get staged as part of the release.

@Mpdreamz Mpdreamz merged commit f842bb7 into main Jul 29, 2024
4 of 5 checks passed
@Mpdreamz Mpdreamz deleted the feature/packaging branch July 29, 2024 10:08
Mpdreamz added a commit that referenced this pull request Jul 31, 2024
Continues #133 

This now puts all required distributions under
`.artifacts/elastic-distribution`.

This includes `elastic-*.zip` versions of the auto instrumentation zips.
These zips include
	* our plugin dll (twice for -windows.zip).
	* `_instrument.sh` a copy of the original `instrument.sh`
	* `instrument.sh` which sets our plugin var and calls `_instrument.sh`

This also includes elastic versions of the installation bash script and
the powershell module to instrument and install/update on windows.

These files should now upload as part of our release and uploaded as
artifacts on each commit in main.

Locally to build the distributables call:

```
./build.sh redistribute
````

To validate the distribution there is now a new dockerfile that
validates our install and instrumentation scripts:

```bash
docker build -t distribution.autoinstrumentation:latest -f examples/Example.AutoInstrumentation/distribution.Dockerfile  . && \
         docker run -it --rm -p 5000:8080 --name distri --platform linux/arm64 distribution.autoinstrumentation:latest
```


The latter will also form the basis for more integration tests which
i'll follow up with
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants